package com.dzsw.javabase.datetime;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;

public class DataFormatSample {

    public static void main(String[] args) throws ParseException {

        String str = "2024/12/06";
        DateFormat df = DateFormat.getDateInstance();
        Date d = df.parse(str);
        System.out.println(new SimpleDateFormat("yyyy-MM-dd").format(d));

        Long ms = 1605174093630L;
        System.out.println(new Date(ms));

        str = "2024/06/06";
        d = df.parse(str);
        System.out.println(new SimpleDateFormat("yyyy-M-dd").format(d));

        str = "2024/11/06";
        d = df.parse(str);
        System.out.println(new SimpleDateFormat("yyyy-M-dd").format(d));

        Instant instant = Instant.parse("2007-12-03T10:15:30.00Z");
        Date date = Date.from(instant);
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));

        System.out.println(50 % 64);
    }
}
